using System.Data;
using Migrator.Framework;

namespace Bxo.Database {
    [Migration(200808192348)]
    public class M200808192348_CreateScenariosTable : Migration {
        public override void Up() {
            this.Database.AddTable(
                    "Scenarios",
                    new Column("Id", DbType.Int32, ColumnProperty.Identity),
                    new Column("Project", DbType.Int32, ColumnProperty.NotNull),
                    new Column("IsActive", DbType.Boolean, ColumnProperty.NotNull)
                    );
            this.Database.AddPrimaryKey("PK_Scenarios", "Scenarios", "Id");
            this.Database.AddForeignKey("FK_Scenarios_Projects", "Scenarios", "Project", "Projects", "Id");
        }

        public override void Down() {
            this.Database.RemoveForeignKey("Scenarios", "FK_Scenarios_Projects");
            this.Database.RemoveTable("Scenarios");
        }
    }
}